
import 'dart:convert';

import 'package:ichinesereader/models/common/Settings.dart';

StudentDetailsDto studentDetailsDtoFromJson(String str) => StudentDetailsDto.fromJson(json.decode(str));

String studentDetailsDtoToJson(StudentDetailsDto data) => json.encode(data.toJson());

class StudentDetailsDto {
    StudentDetailsDto({
        this.firstName,
        this.lastName,
        this.userName,
        this.nickName,
        this.password,
        this.gender,
        this.dateOfBirth,
        this.email,
        this.parentEmail,
        this.level,
        this.settings,
    });

    String? firstName;
    String? lastName;
    String? userName;
    String? nickName;
    String? password;
    String? gender;
    String? dateOfBirth;
    String? email;
    String? parentEmail;
    String? level;
    Settings? settings;

    factory StudentDetailsDto.fromJson(Map<String, dynamic> json) => StudentDetailsDto(
        firstName: json["firstName"],
        lastName: json["lastName"],
        userName: json["userName"],
        nickName: json["nickName"],
        password: json["password"],
        gender: json["gender"],
        dateOfBirth: json["dateOfBirth"],
        email: json["email"],
        parentEmail: json["parentEmail"],
        level: json["level"],
        settings: Settings.fromJson(json["settings"]),
    );

    Map<String, dynamic> toJson() => {
        "firstName": firstName,
        "lastName": lastName,
        "userName": userName,
        "nickName": nickName,
        "password": password,
        "gender": gender,
        "dateOfBirth": dateOfBirth,
        "email": email,
        "parentEmail": parentEmail,
        "level": level,
        "settings": settings?.toJson(),
    };
}

// class Settings {
//     Settings({
//         this.audio,
//         this.lang,
//         this.language,
//         this.pinyin,
//     });

//     bool? audio;
//     String? lang;
//     String? language;
//     bool? pinyin;

//     factory Settings.fromJson(Map<String, dynamic> json) => Settings(
//         audio: json["audio"],
//         lang: json["lang"],
//         language: json["language"],
//         pinyin: json["pinyin"],
//     );

//     Map<String, dynamic> toJson() => {
//         "audio": audio,
//         "lang": lang,
//         "language": language,
//         "pinyin": pinyin,
//     };
// }
